package com.cy.web.controller;

import com.cy.pojo.NoticeLog;
import com.cy.service.LogService;
import com.cy.web.pojo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@ResponseBody
@Controller
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;

    @PostMapping("/doGetLogs")
    public JsonResult doGetLogs(NoticeLog noticeLog){
        return new JsonResult(logService.selectLogs(noticeLog));
    }

    @PostMapping("/doGetLogById/{id}")
    public JsonResult doGetLogById(@PathVariable Integer id){
        return new JsonResult(logService.selectLog(id));
    }

    @DeleteMapping("/deleteLogByIds/{ids}")
    public JsonResult deleteLogByIds(@PathVariable List<Integer> ids){
        return new JsonResult(logService.deleteLogs(ids));
    }
}
